import 'package:flutter/material.dart';
import 'package:furaha_mkopo/commonTool/fm_language_tool.dart';

class FMAuthCompletedDialog extends StatelessWidget {
  Function() onConfirm;
  FMAuthCompletedDialog({super.key,required this.onConfirm});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Container(
            width: 334,
            height: 468,
            decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage(FMLanguageTool.getAssets("assets/home/ic_auth_completed_dialog_bg",suffix: ".webp")),
                  fit: BoxFit.fill),
            ),
            child: Container(
              margin: const EdgeInsets.only(left: 20, right: 20, top: 274),
              child: Column(
                children: [
                  Text(
                    FMLanguageTool.getText("You have completed certification"),
                    textAlign: TextAlign.center,
                    style: const TextStyle(
                        fontSize: 20,
                        color: Color(0xFF333333),
                        fontWeight: FontWeight.w700,
                        decoration: TextDecoration.none),
                  ),
                  Container(
                    margin: const EdgeInsets.only(left: 20, right: 20, top: 6),
                    child: Text(
                      FMLanguageTool.getText('Now you can complete your payment information and submit your loan application.'),
                      textAlign: TextAlign.center,
                      style: const TextStyle(
                          fontSize: 14,
                          color: Color(0xFF333333),
                          fontWeight: FontWeight.w500,
                          decoration: TextDecoration.none),
                    ),
                  ),
                  GestureDetector(
                    behavior: HitTestBehavior.translucent,
                    onTap: (){
                      Navigator.of(context).pop();
                      onConfirm();
                    },
                    child: Container(
                      width: 247,
                      height: 54,
                      alignment: Alignment.center,
                      margin: const EdgeInsets.only(left: 20, right: 20, top: 22),
                      child: Text(
                        FMLanguageTool.getText("Apply Now"),
                        style: const TextStyle(
                            fontSize: 18,
                            color: Colors.white,
                            fontWeight: FontWeight.w700,
                            decoration: TextDecoration.none),
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
          const SizedBox(
            height: 24,
          ),
          GestureDetector(
              onTap: () {
                Navigator.of(context).pop();
              },
              child: Image.asset(
                "assets/home/ic_auth_completed_close.png",
                width: 28,
                height: 28,
              ))
        ],
      ),
    );
  }
}
